<?php
/**
 * @author Feng
 * @date 2012-6-15
 */
class picture_special_keyword_concept extends system_concept_abstract {
	
	public function init() {
		$this->setModel('picture_special_keyword_model', 'special_keyword');
		$this->setModelCols('special_keyword', array('keyword_id', 'special_id'));
	}

	public function save($row) {
		$row->set('special_id', intval($row->get('special_id')));
		$row->set('keyword_id', intval($row->get('keyword_id')));
		
		if($row->getSpecialId() && $row->getKeywordId() && 
				!$this->fetch(array('special_id = ?' => $row->getSpecialId(), 'keyword_id = ?' => $row->getKeywordId()))
			) {
			$this->getModel('special_keyword')->insert($row->getModelData('special_keyword'));
		}
		return $row;
	}

}
